package com.ruoyi.HKISAPI.controller;

import com.ruoyi.HKISAPI.service.ISAPIService;
import com.ruoyi.HKISAPI.utils.AlarmDataParser;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.rsikManage.controller.util.PageUtils;
import com.ruoyi.rsikManage.domain.AlarmEvent;
import com.ruoyi.rsikManage.service.BroadcastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RequestMapping("/ISAPI")
@RestController
public class ISAPIController extends BaseController {

    private final ISAPIService iSAPIService;

    @Autowired
    BroadcastService broadcastService;


    private static ImageDownloader imageDownloader;
    @Autowired
    public void setImageDownloader(ImageDownloader imageDownloader) {
        ISAPIController.imageDownloader = imageDownloader;
    }

    @Autowired // Spring会使用此注解自动装配ISAPIService的实例
    public ISAPIController(ISAPIService iSAPIService) {
        this.iSAPIService = iSAPIService;
    }
    // 分页查询(未过滤)
    @GetMapping("/ContentMgmt/InputProxy/channels")
    public Map<String,Object> selectPageAlarmEvent() {

        return  iSAPIService.getChannels();
    }



    // 分页查询(未过滤)
    @GetMapping("/Event/notification/subscribeEventCap")
    public Map<String,Object> subscribeEventCap() {

        return  iSAPIService.getHKTESTMap();
    }

    // 分页查询(未过滤)
    @GetMapping("/downloadImageWithDigestAuth")
    public Map<String,Object> downloadImageWithDigestAuth(String imageUrl, String username, String password, String localFilePath) {
        return  iSAPIService.downloadImageWithDigestAuth(imageUrl,username,password,localFilePath);
    }

    // 分页查询(未过滤)
    @GetMapping("/2")
    public void updateBroadCastList() {
               broadcastService.updateBroadCastList();

    }


    // 分页查询(未过滤)
    @GetMapping("/ContentMgmt/search")
    public String getContentMgmt(){
        iSAPIService.getContentMgmt();
        return null;
    }

    // 分页查询(未过滤)
    @GetMapping("/atstar/index.php/bcconftask-interface/querybroadcastobject")
    public String selectPageAlarmEvent22(){
        {String a ="{\n" +
                "    \"success\": true,\n" +
                "    \"message\": \"数据操作成功\",\n" +
                "    \"data\": [\n" +
                "        {\n" +
                "            \"phone_name\": \"8501\",\n" +
                "            \"phone_number\": \"8501\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8502\",\n" +
                "            \"phone_number\": \"8502\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"南翼变电所\",\n" +
                "            \"phone_number\": \"8503\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8504\",\n" +
                "            \"phone_number\": \"8504\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8505\",\n" +
                "            \"phone_number\": \"8505\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"北翼变电所\",\n" +
                "            \"phone_number\": \"8506\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"中央变电所\",\n" +
                "            \"phone_number\": \"8507\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8508\",\n" +
                "            \"phone_number\": \"8508\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"避难硐室\",\n" +
                "            \"phone_number\": \"8509\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8510\",\n" +
                "            \"phone_number\": \"8510\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8601\",\n" +
                "            \"phone_number\": \"8601\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"北翼三联巷\",\n" +
                "            \"phone_number\": \"8602\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"井底车场\",\n" +
                "            \"phone_number\": \"8603\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8604\",\n" +
                "            \"phone_number\": \"8604\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8605\",\n" +
                "            \"phone_number\": \"8605\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8606\",\n" +
                "            \"phone_number\": \"8606\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"一采区瓦斯治理巷\",\n" +
                "            \"phone_number\": \"8607\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"北翼无极绳\",\n" +
                "            \"phone_number\": \"8608\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8609\",\n" +
                "            \"phone_number\": \"8609\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"三采区轨道上山口\",\n" +
                "            \"phone_number\": \"8610\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"副斜井250米\",\n" +
                "            \"phone_number\": \"8611\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \" 二采区水泵房\",\n" +
                "            \"phone_number\": \"8612\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"三采区水泵房\",\n" +
                "            \"phone_number\": \"8613\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"三采区瓦斯治理巷\",\n" +
                "            \"phone_number\": \"8614\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2113运输\",\n" +
                "            \"phone_number\": \"8615\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"南翼轨道巷170M\",\n" +
                "            \"phone_number\": \"8616\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2108运输工作面\",\n" +
                "            \"phone_number\": \"8617\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8618\",\n" +
                "            \"phone_number\": \"8618\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8619\",\n" +
                "            \"phone_number\": \"8619\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8620\",\n" +
                "            \"phone_number\": \"8620\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2118运输工作面\",\n" +
                "            \"phone_number\": \"8621\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2108回风工作面\",\n" +
                "            \"phone_number\": \"8622\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2308回风工作面\",\n" +
                "            \"phone_number\": \"8623\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2307回风工作面\",\n" +
                "            \"phone_number\": \"8624\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2307运输口\",\n" +
                "            \"phone_number\": \"8625\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"副斜井440米\",\n" +
                "            \"phone_number\": \"8626\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8627\",\n" +
                "            \"phone_number\": \"8627\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"大门口\",\n" +
                "            \"phone_number\": \"8628\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"二道门\",\n" +
                "            \"phone_number\": \"8629\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8630\",\n" +
                "            \"phone_number\": \"8630\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"南翼无极绳\",\n" +
                "            \"phone_number\": \"8631\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"消防材料库\",\n" +
                "            \"phone_number\": \"8632\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8633\",\n" +
                "            \"phone_number\": \"8633\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offine\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2118回风工作面\",\n" +
                "            \"phone_number\": \"8634\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2308运输工作面\",\n" +
                "            \"phone_number\": \"8635\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"2307运输工作面\",\n" +
                "            \"phone_number\": \"8636\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"offline\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"北翼六联巷\",\n" +
                "            \"phone_number\": \"8637\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"进风立井出口处\",\n" +
                "            \"phone_number\": \"8638\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"副井口\",\n" +
                "            \"phone_number\": \"8639\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"phone_name\": \"8640\",\n" +
                "            \"phone_number\": \"8640\",\n" +
                "            \"dis_group_id\": \"27\",\n" +
                "            \"group_name\": \"KT394(A)矿用广播通信系统\",\n" +
                "            \"reg_state\": \"online\",\n" +
                "            \"call_state\": \"idle\"\n" +
                "        }\n" +
                "    ]\n" +
                "}";}
                return null;
    }



}
